package main

import "fmt"

type Animal interface {
	eat()
}
type Cat struct {
	gender string
	age    uint8
}

func (self Cat) eat() {
	fmt.Println("eatting \"maio\"")
}

func main() {

	var animal Animal = &Cat{gender: "female", age: 6}
	fmt.Println(animal)
	animal.eat()
	if _, ok := animal.(*Cat); ok {
		fmt.Println("类型断言成功")
	} else {
		fmt.Println("类型断言失败")
	}

}
